@(events: List[Event])


@import helper._
@import helper.twitterBootstrap._

@main("Event List","list") {
<link href="@routes.Assets.at("css/bootstrap.css")" rel="stylesheet">
<div class="container">
    <h2>Event's list</h2>
    <table class="table table-striped table-bordered">
        <thead>
        <tr>
            <th  style="min-width:10px; max-width:900px;width:auto; white-space:nowrap;">Event</th>
            <th style="width:104px;">From</th>
            <th style="width:104px;">To</th>
            <th style="width:14px;"><a href="@routes.Calendar.blank()" title="Add new event"><i class="icon-plus"></i></a></th>
            <th style="width:14px;"><a href="@routes.Calendar.blank()" title="Start video session"><i class="icon-video"></i></a></th>
        </tr>
        </thead>
        <tbody>
        @for(event <- events){
        <tr>
            <td><a href="@routes.Calendar.edit(event.id)">@event.title</a></td>
            @if(event.allDay && event.endsSameDay){
                <td colspan="2">@if(event.start == null){ - } else {@event.start.format("dd.MM.yyyy") (All day)}</td>
            } else {
                @if(event.allDay){
                    <td colspan="2">@if(event.start == null){ - } else {@event.start.format("dd.MM.yyyy")} - @if(event.end == null){ - } else {@event.end.format("dd.MM.yyyy")} (All days)</td>
                } else {
                    <td>@if(event.start == null){ - } else {@event.start.format("dd.MM.yyyy H:mm")}</td>
                    <td>@if(event.end == null){ - } else {@event.end.format("dd.MM.yyyy H:mm")}</td>
                }
            }
            <td><a href="@routes.Calendar.delete(event.id)"><i class="icon-trash"></i></a> </td>
            <td><a href="@routes.Application.checkToTeachOrLearn(event.id)"><i class="icon-video"></i></a> </td>
        </tr>
        }
        </tbody>
    </table>
    

</div>

}